
package com.be.beadmin.project.service;


import com.be.beadmin.common.entity.PageEntity;
import com.be.beadmin.project.dto.input.BatchProduceSimpDto;
import com.be.beadmin.project.dto.input.BatchProductDto;
import com.be.beadmin.project.dto.output.BatchProductEx;
import com.be.beadmin.project.entity.BatchProduct;
import com.be.beadmin.project.entity.Info;
import io.minio.errors.*;
import org.springframework.data.domain.Page;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import java.text.ParseException;
import java.util.HashMap;
import java.util.List;

/**
* @description 服务接口
* @author zjm
* @date 2023-02-13
**/
public interface BatchProductService {

    /**
    * 分页的查询接口
    * @param pageEntity
    * @return
    */
    Page<BatchProductEx> getBatchProductByPage(PageEntity pageEntity);

    /**
     * 根据批次计划id获取所有的批次柜体
     * @param batchPlanId
     * @return
     */
    List<BatchProduct> getBatchProductByBatchPlanId(String batchPlanId);


    /**
     * 根据id获取柜体
     * @param id
     * @return
     */
   BatchProduct getBatchProductById(String id);


    /**
     * 分页的查询接口BatchProduct
     * @param pageEntity
     * @return
     */
    Page<BatchProduct> getBatchProductEntityByPage(PageEntity pageEntity);

    /**
    * @param batchProductDto
    */
    void addBatchProduct(BatchProductDto batchProductDto);

    /**
    * @param batchProductDto
    */
    void updateBatchProduct(BatchProductDto batchProductDto);



    /**
    * @param id
    */
    void delBatchProduct(String id);


    List<BatchProduceSimpDto> getProductByBatchPlan(String batchPlanId);

    /**
     *
     * @return
     */
    List<String> getProduceType();


    HashMap<String, String> getProductTypeAndCode();
    void designReview(String batchProductId, int reviewState, String reviewMemo, MultipartFile multipartFile) throws InvalidBucketNameException, InsufficientDataException, ErrorResponseException, IOException, NoSuchAlgorithmException, InvalidKeyException, InvalidResponseException, XmlParserException, InternalException;

//    设计审核
    void commitDesignReview(String batchProductId) throws InvalidBucketNameException, InsufficientDataException, ErrorResponseException, IOException, NoSuchAlgorithmException, InvalidKeyException, InvalidResponseException, XmlParserException, InternalException, ParseException;

    void confirmDesignReview( String batchProductId, int reviewState, String reviewMemo, MultipartFile multipartFile) throws InvalidBucketNameException, InsufficientDataException, ErrorResponseException, IOException, NoSuchAlgorithmException, InvalidKeyException, InvalidResponseException, XmlParserException, InternalException, ParseException;
    //批量审核通过或驳回
    void batchConfirmDesignReview(List<String> batchProductId, int reviewState, String reviewMemo, MultipartFile multipartFile) throws InvalidBucketNameException, InsufficientDataException, ErrorResponseException, IOException, NoSuchAlgorithmException, InvalidKeyException, InvalidResponseException, XmlParserException, InternalException, ParseException;

    void  refuseDesignReview(String batchProductId);
    void setBop(String batchProductId,String bopCode);

    /**
     *
     * @return
     */
    List<String> getErroType();


    /**
     * 获取柜体待分配数量
     * @param infoId
     */
    int getRestProductNums(String infoId);

    /**
     * 柜体设计的分页查询接口
     * @param pageEntity
     * @return
     */
    Page<BatchProduct> getBatchProductDesignByPage(PageEntity pageEntity);

    /**
     * 柜体设计已下发的分页查询接口
     * @param pageEntity
     * @return
     */
    Page<BatchProduct> getBatchProductDesignReleasedByPage(PageEntity pageEntity);

    /**
     * 删除指定项目下的所有柜体以及柜体的相关信息
     * @param info
     */
    void deleteBatchProductAndRelationInfo(Info info);

    /**
     * 根据柜体编码获取工时对比信息
     * @param productCode
     * @return
     */
    BatchProduct getWorkingHoursComparisonsByProductCode(String productCode);
}